import request from '@/utils/request'
export const getRolesListRequest = params => request.get('/sys/role', { params })

export const addRolesRequest = data => request.post('/sys/role', data)
// 封装更新角色接口
export const updateRoleByIdRequest = data => request.put(`/sys/role/${data.id}`, data)
// 删除角色接口
export const deleteRoleByIdRequest = id => request.delete(`/sys/role/${id}`)

// 分配角色权限
export const assignPermissionRequest = data => request.put(`/sys/role/assignPrem`, data)
// 角色权限回显
export const getRolePermByIdRequest = id => request.get(`/sys/role/${id}`)
